Optimal. Leaf size=32 \[ a x (A+B)+\frac{a A \tanh ^{-1}(\sin (c+d x))}{d}+\frac{a B \sin (c+d x)}{d} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.0913122, antiderivative size = 32, normalized size of antiderivative = 1., number of steps used = 4, number of rules used = 4, integrand size = 27, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.148, Rules used = {2968, 3023, 2735, 3770} \[ a x (A+B)+\frac{a A \tanh ^{-1}(\sin (c+d x))}{d}+\frac{a B \sin (c+d x)}{d} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 2968
Rule 3023
Rule 2735
Rule 3770
Rubi steps
\begin{align*} \int (a+a \cos (c+d x)) (A+B \cos (c+d x)) \sec (c+d x) \, dx &=\int \left (a A+(a A+a B) \cos (c+d x)+a B \cos ^2(c+d x)\right ) \sec (c+d x) \, dx\\ &=\frac{a B \sin (c+d x)}{d}+\int (a A+a (A+B) \cos (c+d x)) \sec (c+d x) \, dx\\ &=a (A+B) x+\frac{a B \sin (c+d x)}{d}+(a A) \int \sec (c+d x) \, dx\\ &=a (A+B) x+\frac{a A \tanh ^{-1}(\sin (c+d x))}{d}+\frac{a B \sin (c+d x)}{d}\\ \end{align*}
Mathematica [A] time = 0.0241613, size = 46, normalized size = 1.44 \[ \frac{a A \tanh ^{-1}(\sin (c+d x))}{d}+a A x+\frac{a B \sin (c) \cos (d x)}{d}+\frac{a B \cos (c) \sin (d x)}{d}+a B x \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A] time = 0.076, size = 56, normalized size = 1.8 \begin{align*} aAx+aBx+{\frac{aA\ln \left ( \sec \left ( dx+c \right ) +\tan \left ( dx+c \right ) \right ) }{d}}+{\frac{Aac}{d}}+{\frac{aB\sin \left ( dx+c \right ) }{d}}+{\frac{Bac}{d}} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A] time = 0.989942, size = 63, normalized size = 1.97 \begin{align*} \frac{{\left (d x + c\right )} A a +{\left (d x + c\right )} B a + A a \log \left (\sec \left (d x + c\right ) + \tan \left (d x + c\right )\right ) + B a \sin \left (d x + c\right )}{d} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A] time = 1.45065, size = 139, normalized size = 4.34 \begin{align*} \frac{2 \,{\left (A + B\right )} a d x + A a \log \left (\sin \left (d x + c\right ) + 1\right ) - A a \log \left (-\sin \left (d x + c\right ) + 1\right ) + 2 \, B a \sin \left (d x + c\right )}{2 \, d} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F] time = 0., size = 0, normalized size = 0. \begin{align*} a \left (\int A \sec{\left (c + d x \right )}\, dx + \int A \cos{\left (c + d x \right )} \sec{\left (c + d x \right )}\, dx + \int B \cos{\left (c + d x \right )} \sec{\left (c + d x \right )}\, dx + \int B \cos ^{2}{\left (c + d x \right )} \sec{\left (c + d x \right )}\, dx\right ) \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [B] time = 1.23301, size = 107, normalized size = 3.34 \begin{align*} \frac{A a \log \left ({\left | \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right ) + 1 \right |}\right ) - A a \log \left ({\left | \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right ) - 1 \right |}\right ) +{\left (A a + B a\right )}{\left (d x + c\right )} + \frac{2 \, B a \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right )}{\tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right )^{2} + 1}}{d} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]